/**
 * 供应链看板数据类型定义
 */

export interface SupplyChainDashboardData {
  overviewMetrics: OverviewMetrics
  inventoryAnalysis: InventoryAnalysis
  turnoverAnalysis: TurnoverAnalysis
  targetAchievement: TargetAchievement
  storePerformanceList: StorePerformance[]
  inventoryAlerts: InventoryAlert[]
  trendData: TrendData
}

export interface OverviewMetrics {
  totalInventoryAmount: number
  totalInventoryQuantity: number
  spotAmount: number
  inTransitAmount: number
  avgTurnoverDays: number
  alertProductCount: number
  activeStoreCount: number
  pvSpotRate: number
}

export interface InventoryAnalysis {
  spotRatio: number
  inTransitRatio: number
  inventoryHealthStatus: string
  distributionData: InventoryDistribution[]
}

export interface InventoryDistribution {
  category: string
  amount: number
  percentage: number
}

export interface TurnoverAnalysis {
  fastTurnoverCount: number
  mediumTurnoverCount: number
  slowTurnoverCount: number
  turnoverEfficiencyChange: number
  bestTurnoverStore: string
  bestTurnoverDays: number
}

export interface TargetAchievement {
  monthlyNrTarget: number
  orderedAmount: number
  achievementRate: number
  estimatedCompletionDate: string
  targetStatus: string
  targetGap: number
}

export interface StorePerformance {
  storeName: string
  inventoryAmount: number
  turnoverDays: number
  achievementRate: number
  pvSpotRate: number
  ranking: number
  trend: 'up' | 'down' | 'stable'
}

export interface InventoryAlert {
  storeName: string
  alertType: 'low_stock' | 'overstock' | 'slow_turnover'
  alertLevel: 'high' | 'medium' | 'low'
  alertDescription: string
  estimatedStockoutDays?: number
  recommendedAction: string
}

export interface TrendData {
  inventoryAmountTrend: TrendPoint[]
  turnoverDaysTrend: TrendPoint[]
  achievementRateTrend: TrendPoint[]
}

export interface TrendPoint {
  date: string
  value: number
  label: string
}

export interface DateRangeQuery {
  startDate?: string
  endDate?: string
}

export interface StorePerformanceQuery {
  reportDate?: string
  sortBy?: string
  limit?: number
}

export interface InventoryAlertQuery {
  reportDate?: string
  alertLevel?: string
}

export interface TrendQuery {
  startDate?: string
  endDate?: string
  trendType?: string
} 